import request from '@/utils/request'

// 获取预约列表
export function getAppointmentList(userId) {
  return request({
    url: `/api/appointments?userId=${userId}`,
    method: 'get'
  })
}

// 取消预约 - 简化为只传递预约ID
export function cancelAppointment(appointmentId) {
  return request({
    url: `/api/appointments/${appointmentId}/cancel`,
    method: 'post'
  })
}

// 支付预约
export function payAppointment(appointmentId, userId) {
  return request({
    url: `/api/appointments/${appointmentId}/pay?userId=${userId}`,
    method: 'post'
  })
}

// 删除预约记录
export function deleteAppointment(appointmentId) {
  return request({
    url: `/api/appointments/${appointmentId}`,
    method: 'delete'
  })
} 